<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/commons/pages/taglibs.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>车辆信息管理</title>
<link rel="stylesheet" type="text/css" href="../jquery-easyui/themes/${themes}/easyui.css">
<link rel="stylesheet" type="text/css" href="../jquery-easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../styles/demo.css">
<script type="text/javascript" src="../jquery-easyui/jquery.min.js"></script>
<script type="text/javascript" src="../jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../scripts/public.js.jsp"></script>
<script type="text/javascript" src="${ctx}/platform/type-info/format"></script>
</head>
<body>
<!--div class="demo-info">
  <div class="demo-tip icon-tip"></div>
  <div>车辆信息管理</div>
</div-->
<c:if test="${true}">
  <div style="padding:5px; margin-bottom:5px; display:block;" class="combo">
    <form method="post" id="fm_search" novalidate style="display:inline-block">
      DTU ID：
        <select id="modem_id" name="modem_id" style="width:80px;">
      </select>
      车牌号:
      <input name="car_no" type="text" size="10" maxlength="20" />
      车主:
      <input name="car_owner" type="text" size="10" maxlength="20" />
      车主联系电话:
      <input name="car_owner_tel" type="text" size="10" maxlength="20" />
      车辆提供商:
      <input name="car_vender" type="text" size="10" maxlength="20" />
      激活：
      <select id="is_active" name="is_active" style="width:60px;">
      </select>
      <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="doSearch();">搜索</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'" onclick="$('#fm_search').form('clear');">重置</a>
    </form>
  </div>
</c:if>
<div id="dg"> </div>
<div id="dlg" class="easyui-dialog"  data-options="closed:true, modal:true, buttons:'#dlg-buttons'" style="width:400px; height:320px; padding:10px 20px">
  <form method="post" id="fm" novalidate>
    <input name="id" type="hidden" id="id" />
    <table>
      <tr>
        <td align="right" width="160"><b>DTU ID：</b></td>
        <td width="240"><select id="modem_id" name="modem_id" style="width:80px;" class="easyui-validatebox" data-options="required:true">
          </select></td>
      </tr>
      <tr>
        <td align="right"><b>车牌号：</b></td>
        <td><input name="car_no" type="text" id="car_no" size="20" maxlength="20" class="easyui-validatebox" data-options="required:true" /></td>
      </tr>
      <tr>
        <td align="right"><b>车主：</b></td>
        <td><input name="car_owner" type="text" id="car_owner" size="20" maxlength="20" class="easyui-validatebox" data-options="required:true" /></td>
      </tr>
      <tr>
        <td align="right"><b>车主联系电话：</b></td>
        <td><input name="car_owner_tel" type="text" id="car_owner_tel" size="20" maxlength="20" class="easyui-validatebox" data-options="required:true" /></td>
      </tr>
      <tr>
        <td align="right"><b>注册时间：</b></td>
        <td><input name="regist_time" type="text" id="regist_time" size="10" maxlength="10" class="easyui-datebox" style="width:90px;" data-options="required:true, editable:false" /></td>
      </tr>
      <tr>
        <td align="right"><b>车辆提供商：</b></td>
        <td><input name="car_vender" type="text"  id="car_vender"  size="32" maxlength="32" class="easyui-validatebox" data-options="required:true" /></td>
      </tr>
      <tr>
        <td align="right"><b>是否激活：</b></td>
        <td><select id="is_active" name="is_active" style="width:60px;" class="easyui-validatebox" data-options="required:true, editable:false">
          </select></td>
      </tr>
    </table>
  </form>
</div>
<div id="dlg-buttons"> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="doSave();">保存</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="$('#dlg').dialog('close');">关闭</a> </div>
<script type="text/javascript">
$(function(){
	//初始化列表
	$('#dg').datagrid({  
	    url:'${ctx}/platform/car-info/search',
		queryParams:$('#fm_search').serializeObject(),
	    frozenColumns:[[
	    	{field:'ck',checkbox:true}
	 	]],
	    columns:[[
			//{field:'id',title:'id',hidden:true},   
			{align:'center', title:'DTU ID', field: 'modem_id'},
			{align:'left',   title:'车牌号', field: 'car_no'},
			{align:'left',   title:'车主', field: 'car_owner'}, 
			{align:'left',   title:'车主联系电话', field: 'car_owner_tel'}, 
			{align:'left',   title:'注册时间', field: 'regist_time', formatter:formatDate},
			{align:'left',   title:'车辆提供商', field: 'car_vender'},
			{align:'center', title:'激活', field:'is_active', formatter:formatBoolean, styler:styleBoolean}
	    ]],
		fitColumns:true,
		striped:true,
		pagination:true,
		remoteSort:false,
		rownumbers:true,
		singleSelect:false,
		autoSizeColumn:true,
		toolbar:[
			//<c:if test="${true}">
			{
				id:'btnRemove',
				text:'删除',
				iconCls:'icon-remove',
				handler:function(){doRemove();}
			},'-',
			//</c:if>
			//<c:if test="${true}">
			{
				id:'btnAdd',
				text:'添加',
				iconCls:'icon-add',
				handler:function(){doAdd();}
			},
			//</c:if>
			//<c:if test="${true}">
			{
				id:'btnEdit',
				text:'修改',
				iconCls:'icon-edit',
				handler:function(){doEdit();}
			},
			//</c:if>{}
		] 
	}); 
}); 
</script>
</body>
</html>